using UnityEngine;
using UnityEngine.UI;

//有这行生成的脚本都是UTF-8形式的

namespace MyGame
{
    public class EnterGameUI : BaseUI<EnterGameUI>
    {
        public MyButton enterGame_button;
        public Text GameVersion;
        public Text GameUpdateeExplain;

        protected override void Awake()
        {
            //注册菜单
            UIManager.Instance.RegisterMenu(uIType, gameObject);

            RegisterAction();
        }

        private void Start()
        {
            GameVersion.text = "版本号:1.0.0";
            GameUpdateeExplain.text = "更新说明:";
        }

        public void EnterGame()
        {
            UIManager.Instance.EntetGame();         
        }

        void RegisterAction()
        {
            enterGame_button.myAction_Click += EnterGame;

            enterGame_button.myAction_Enter += () =>
            {
                enterGame_button.transform.localScale = Vector3.one * 1.2f;
                enterGame_button.myImage.color = Color.red;
            };

            enterGame_button.myAction_Exit += () =>
            {
                enterGame_button.transform.localScale = Vector3.one * 1;
                enterGame_button.myImage.color = Color.black;
            };
        }

        private void OnDestroy()
        {
            //注册菜单
            UIManager.Instance.UnregisterMenu(uIType);
        }
    }
}



